uniform sampler3D volume; 
uniform sampler1D transferFunc;
 
void main() { 
    // 
    // Sample the scalar volume at the fragment position or 3Dtexture coord. 
    //     
    vec3 pos = vec3(gl_TexCoord[0]);     
    vec4 scalarValue = texture3D( volume, vec3(gl_TexCoord[0] ));
    //
    // Map the scalar value to an RGBA value.
    //    
    vec4 lookup = texture1D( transferFunc, scalarValue.a ); 
    // 
    // Modulate the opacity by the base. 
    //     
    gl_FragColor = lookup;     
    //gl_FragColor = scalarValue  + 0.3;     
    //gl_FragColor.a = gl_Color.a * lookup.a; 
    //gl_FragColor.a = gl_Color.a * scalarValue.a; 
}


